<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">


<h:body>
	<ui:composition template="/templates/template.xhtml">

		<ui:define name="conteudoPagina">

			<h:form id="formCadEvento">
				<p:messages id="mensagem" closable="true" />
				<p:panel header="Add event">
					<h:panelGrid id="grid" columns="2" cellpadding="5"  >
						<p:outputLabel value="Nome do Evento:" />
						<p:inputText id="txtNomeEvento"
							value="#{eventoBean.eventoSelecionado.nome}" size="25"
							 />
						<p:outputLabel value="Tipo:" />
						<p:selectOneMenu id="cboTipos"
							value="#{eventoBean.eventoSelecionado.tipo}" >
							<f:selectItem itemLabel="Escolha um tipo de Evento" />
							<f:selectItems value="#{eventoBean.tipoSelect}" />
						</p:selectOneMenu>
						<p:outputLabel id="txtGenero" value="Genero:" />
						<p:inputText size="25" />
						<p:outputLabel id="txtLocal" value="Local:" />
						<p:inputText value="#{eventoBean.eventoSelecionado.local}"
							size="25" />
						<p:outputLabel value="Data de Início:" />
						<p:calendar id="calDataInicio"
							value="#{eventoBean.eventoSelecionado.dataInicio}" size="25"
							></p:calendar>
						<p:outputLabel value="Data de Término:" />
						<p:calendar id="calDataFinal"
							value="#{eventoBean.eventoSelecionado.dataFinal}" size="25"
							></p:calendar>
						<p:outputLabel value="Descrição" />
						<p:inputTextarea id="textArea"
							value="#{eventoBean.eventoSelecionado.descricao}" size="10000"
							 />
						<p:outputLabel value="Add Foto" />
						<p:fileUpload fileUploadListener="#{eventoBean.handleFileUpload}"
							mode="advanced"
							dragDropSupport="false" fileLimit="1"
							allowTypes="/(\.|\/)(gif|jpe?g|png)$/" 
							update="msgImage"/>
						<div id="divG">
							<p:growl id="msgImage"  sticky="true" />		
						</div>
					</h:panelGrid>
					</p:panel>
					<p:separator/>
					
					<p:commandButton value="Salvar" action="#{eventoBean.salvar}"
						icon="ui-icon-disk"  update="formCadEvento"/>
					<p:commandButton value="DIALOG" onclick="Teste.show()" update="dialogT"  />			
				
					<p:dialog id="dialogT" header="TESTE" widgetVar="Teste"></p:dialog>
				
			</h:form>
		
			
		

		</ui:define>
	</ui:composition>
</h:body>
</html>